---
title: Configuration
summary: Environment API settings, runtime-resolved database connection, appSettings, and environment variance for PdfAPI.
status: draft
owner: Not determined from source
last_reviewed: 2026-09-17
library: PdfAPI
reference_type: embedded
---

# Configuration

## Environment API settings

All ten keys below are read through `IEnvironmentService` (`GetConfigSetting` / `GetConfigSetting<T>`). None have a value stored in this repository — values are resolved at run time from the central SAIF environment-config store, keyed by application name and `ApplicationHost`.

| Setting key | Type | Secure | Consuming class | Source |
| --- | --- | --- | --- | --- |
| `pdfapi.pdfservicetype` | `string` | No | `PdfServiceFactory` | `PdfAPI\Services\PdfServiceFactory.cs:43` |
| `pdfapi.rootdirectory` | `string` | No | `PdfService` (abstract base) | `PdfAPI\Services\PdfService.cs:29` |
| `pdfapi.saveInputToTemp` | `bool` | No | `PdfService` (abstract base) | `PdfAPI\Services\PdfService.cs:30` |
| `noreplyemailsenderaddress` | `string` | No | `PdfService.SendIncidentEmail` | `PdfAPI\Services\PdfService.cs:136` |
| `pdfapi.ErrorEmail.Recipient` | `string` | No | `PdfService.SendIncidentEmail` | `PdfAPI\Services\PdfService.cs:137` |
| `pdfApi.ErrorsToRetry` | `string` (CSV of `long`) | No | `ActivePdfService` (ctor) | `PdfAPI\Services\ActivePdf\ActivePdfService.cs:20` |
| `pdfapi.activepdfworkingdirectory` | `string` (UNC fragment, no leading `\\`) | No | `ActivePdfService` | `PdfAPI\Services\ActivePdf\ActivePdfService.cs:99` |
| `pdfapi.activepdfServer` | `string` | No | `ActivePdfService` | `PdfAPI\Services\ActivePdf\ActivePdfService.cs:100` |
| `pdfapi.activepdfPort` | `long` | No | `ActivePdfService` | `PdfAPI\Services\ActivePdf\ActivePdfService.cs:101` |
| `pdfapi.HKCU_Word_DocumentRecovery_SubKey` | `string` (registry sub-key path) | No | `ActivePdfService.DeleteWordDocumentRecoveryRegistryKey` | `PdfAPI\Services\ActivePdf\ActivePdfService.cs:266` |

### Behavioral notes

- **`pdfapi.pdfservicetype` is a processor selector, not a flag.** Lower-cased comparison: `"activepdf"` selects `ActivePdfService`; any other value (including an unrecognized one) selects `SyncfusionPdfService` ([BR-PDFAPI-003](business-rules.md#br-pdfapi-003-processor-selection-by-configuration)). No validation and no failure path exists for a bad value.
- **`pdfapi.rootdirectory` and `pdfapi.saveInputToTemp` are read in the `PdfService` base constructor**, so both are required for every request regardless of which processor is selected. A missing or unparseable value fails during DI resolution, not inside an action.
- **`pdfApi.ErrorsToRetry` is parsed unguarded**: `errorsToRetryConfig.Split(',').Select(x => long.Parse(x))`. A null, empty, or non-numeric value throws during `ActivePdfService` construction — see [Tech debt](tech-debt.md).
- **`pdfapi.activepdfworkingdirectory` is a UNC fragment, not a full path** — interpolated as `$@"\\{activePdfWorkingDirectory}\{trackingRecord.FileId}"`, so the configured value must omit the leading `\\`.
- The four ActivePDF keys are read only on the ActivePDF processor branch; a Syncfusion-configured deployment never reads them.

## Runtime-resolved database connections

**There is no `<connectionStrings>` element anywhere in `PdfAPI\Web.config`.** The Oracle connection used for PDF tracking persistence is composed entirely at run time in the composition root; the resolved connection string never appears in this repository.

### Resolution call

```csharp
builder.Register(x => x.ResolveNamed<IUnitOfWorkFactory>("oracle")
    .GetUnitOfWork(
        DbConnectionManager.GetOracleConnectionString(
            x.Resolve<IEnvironmentService>(), EnvironmentConfigKeys.OracleDatabase, "IMG")
    )
).As<IUnitOfWork>()
.InstancePerRequest();
```

`PdfAPI\App_Start\IocConfig.cs:17-23`.

| Aspect | Value |
| --- | --- |
| Resolution method | `DbConnectionManager.GetOracleConnectionString` (`SAIF.Services.Common`) |
| Environment key | `EnvironmentConfigKeys.OracleDatabase` (SAIF framework constant; its literal string value is Unknown** from this repository) |
| Schema argument | Hard-coded literal `"IMG"` at the call site — see [Tech debt](tech-debt.md) |
| Lifetime | `InstancePerRequest` — one unit of work (and connection) per HTTP request |
| Consumer | `PdfTrackingService`, reached from every controller action that tracks a conversion |

No other connection-resolution mechanism (`DbConnectionServiceProxy`, `GetSqlConnectionString`, or a `<connectionStrings>` entry) exists anywhere in this repository. `PdfAPI\Web.Debug.config` and `PdfAPI\Web.Release.config` each contain only a commented-out stock XDT `MyDB`/`ReleaseSQLServer` sample transform — dead, non-live configuration that is excluded from this analysis and must not be mistaken for an active connection string.

## Web.config appSettings

Source: `PdfAPI\Web.config` (real application settings only; scaffolding noise is listed separately below).

| Setting key | Value in `Web.config` | Consuming class |
| --- | --- | --- |
| `ApplicationHost` | `entdev01` | SAIF `EnvironmentServiceBase`/`WebEnvironmentService` — resolves which environment tier's settings the Environment API returns* |
| `FontSubstitutions` | JSON array of three Arial-family substitution entries (`Arial,Bold+000041`→`Arial,Bold`; `Arial+000040`→`Arial`; `Arial,Italic+000042`→`Arial,Italic`) | Unknown** consumer — no read exists in this repository; most plausibly read by the ActivePDF or Syncfusion conversion package for font fallback during Office→PDF conversion* |

**`ApplicationHost = entdev01` is a committed development host name** with no active `Web.Debug.config`/`Web.Release.config` transform overriding it — see [Tech debt](tech-debt.md). Sibling projects corroborate per-environment variance of the same key: `PdfAPI.Tests\App.config` sets `enttest03`; `PdfApiClientTester\PdfApiClientTester\App.config` sets `netprod`.

### Scaffolding noise (excluded from environment variance, recorded once)

| Key | Value | Why it is noise |
| --- | --- | --- |
| `webpages:Version` | `3.0.0.0` | ASP.NET Web Pages runtime version, template-emitted |
| `webpages:Enabled` | `false` | ASP.NET Web Pages toggle, template-emitted |
| `ClientValidationEnabled` | `true` | MVC client-side validation; this API renders no forms |
| `UnobtrusiveJavaScriptEnabled` | `true` | MVC unobtrusive-JS toggle; this API renders no views |

### Non-appSettings runtime limits

| Element | Value | Significance |
| --- | --- | --- |
| `httpRuntime/@maxRequestLength` | `1048576` (KB = 1 GB) | Raised far above the 4 MB default to accept `byte[]` document bodies |
| `requestFiltering/requestLimits/@maxAllowedContentLength` | `1073741824` (bytes = 1 GB) | IIS-level counterpart; both must be raised together |
| `compilation/@debug` | `true` | Debug compilation committed to source control — see [Tech debt](tech-debt.md) |
| `compilation/@targetFramework`, `httpRuntime/@targetFramework` | `4.6.2` | .NET Framework 4.6.2 target |

## Secure settings

**None.** Zero call sites for `GetSecureConfigSetting(` exist anywhere in this repository. No credential, encrypted setting, or crypto-hash-gated configuration is retrieved by this application.

Credential-shaped values that are present but **not** retrieved securely (recorded here as configuration-adjacent findings; see [Tech debt](tech-debt.md) for remediation framing):

| Value | Location | Finding |
| --- | --- | --- |
| Syncfusion license key (string literal) | `PdfApi.SyncFusionCore\LicenseHelper.cs`, invoked from `PdfAPI\Global.asax.cs` | Vendor license key embedded as a source literal rather than retrieved via `GetSecureConfigSetting` |
| SMTP host `"mail.saif.com"` | `PdfAPI\Services\PdfService.cs:140` | Environment-varying infrastructure endpoint hard-coded; the sender/recipient addresses beside it *are* configuration, the host is not |

## Custom configuration sections

None application-defined. `PdfAPI\Web.config` has no `<configSections>` element. The `system.web.webPages.razor` section group in `PdfAPI\Views\Web.config` is stock MVC scaffolding, not an application configuration section, and is excluded.

## Declared-but-unreferenced configuration

`PdfAPI.Core\Services\PdfSettings.cs` declares nine configuration key constants (including `pdfdatadirectory` and `pdfapi.url`, which are **not** read anywhere in `PdfAPI\`) and eagerly loads them via a `Func<string, string>` delegate constructor. **No construction of `PdfSettings` was found anywhere in `PdfAPI\`** — the service layer reads each key directly from `IEnvironmentService` instead, duplicating the key literals. `PdfSettings` is flagged as declared-but-unreferenced in this project* — see [Tech debt](tech-debt.md).

## Environment variance

| Setting key | Varies by environment | Basis |
| --- | --- | --- |
| `ApplicationHost` | Yes | Observed as `entdev01`/`enttest03`/`netprod` across sibling configs |
| Runtime-resolved Oracle connection (`EnvironmentConfigKeys.OracleDatabase`) | Yes | Resolves to a per-environment Oracle instance |
| `pdfapi.pdfservicetype` | Yes | Selects ActivePDF vs Syncfusion — a deployment-topology decision |
| `pdfapi.rootdirectory` | Yes | Filesystem path to the working/output tree |
| `pdfapi.saveInputToTemp` | Likely* | Behavioral toggle, plausibly on in lower environments only |
| `noreplyemailsenderaddress` | Yes | Non-production environments should not mail production addresses |
| `pdfapi.ErrorEmail.Recipient` | Yes | Email address / distribution list |
| `pdfApi.ErrorsToRetry` | Unlikely* | List of vendor error codes; a product characteristic, not an environment one |
| `pdfapi.activepdfworkingdirectory` | Yes | UNC share fragment |
| `pdfapi.activepdfServer` | Yes | Server host name |
| `pdfapi.activepdfPort` | Possibly | Port; commonly uniform but deployable per environment |
| `pdfapi.HKCU_Word_DocumentRecovery_SubKey` | Unlikely* | Office version-dependent registry path, not tier-dependent |
| `FontSubstitutions` | No | Font fallback map; a product characteristic |
| `maxRequestLength` / `maxAllowedContentLength` | No | Payload ceiling, uniform across tiers |
| Scaffolding keys (4) | No | Template-emitted constants |

## Formatter and logging configuration

| Aspect | Finding |
| --- | --- |
| Formatters | `config.Formatters.Remove(config.Formatters.XmlFormatter);` in `WebApiConfig.cs` — JSON only. No custom `JsonSerializerSettings`, no `CamelCasePropertyNamesContractResolver` |
| Serializer | `Newtonsoft.Json` `8.0.3` |
| Logging | SAIF `ILogService` (`LogException`, `TraceError`, `TraceWarn`, `TraceDebug`); `log4net 2.0.5` in `packages.config`; backend configuration not visible in this repository |
| Error detail policy | `config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;` — produces framework exception detail in all environments, before `ApiResponseHandler` runs; the final client-visible envelope is unknown** — see [Endpoints: Error response shape](endpoints.md#error-response-shape) and [Tech debt](tech-debt.md) |

## Related documentation
- [API index](index.md)
- [Overview](overview.md)
- [Architecture](architecture.md)
- [Endpoints](endpoints.md)
- [Authentication and authorization](authentication-authorization.md)
- [Dependencies](dependencies.md)
- [Operations and processes](operations-processes.md)
- [Business rules](business-rules.md)
- [Data model](data-model.md)
- [Operational runbook](operational-runbook.md)
- [Tech debt](tech-debt.md)

> **Note:** Statements marked with `*` were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with `**` could not be confirmed; treat as unknown until verified.

## Sources
- PdfAPI\Web.config
- PdfAPI\Web.Debug.config
- PdfAPI\Web.Release.config
- PdfAPI\App_Start\IocConfig.cs
- PdfAPI\App_Start\WebApiConfig.cs
- PdfAPI\Services\PdfServiceFactory.cs
- PdfAPI\Services\PdfService.cs
- PdfAPI\Services\ActivePdf\ActivePdfService.cs
- PdfAPI.Core\Services\PdfSettings.cs
- PdfAPI.Tests\App.config
- PdfApiClientTester\PdfApiClientTester\App.config
